package com.sxc.OnlineStore.order.dao;

import com.sxc.OnlineStore.Utils.ConnectMySql;
import com.sxc.OnlineStore.order.domain.Orders;

import java.sql.*;

public class OrdersImp {
    private Connection conn = ConnectMySql.conMysql();//定义好数据库对象
    private CallableStatement cs = null; //定义并初始化调用存储过程
    private ResultSet rs = null; //定义rs
    private PreparedStatement ps = null;
    private String sql = null;


    public void AddOrders( String orderGoodsDetails,String orderGoodsPicture,String orderGoodsPrice,String orderGoodsNum,String orderGoodsSumPrice,String orderDate,String orderDeliveryMethod){
        Orders orders = new Orders();
        try {

            cs = conn.prepareCall("call P_addOrders(?,?,?,?,?,?,?)");
            cs.setString(1,orderGoodsDetails);
            cs.setString(2,orderGoodsPicture);
            cs.setString(3,orderGoodsPrice);
            cs.setString(4,orderGoodsNum);
            cs.setString(5,orderGoodsSumPrice);
            cs.setString(6,orderDate);
            cs.setString(7,orderDeliveryMethod);

            rs = cs.executeQuery();



        } catch (SQLException e) {
            e.printStackTrace();
        }


    }


}
